.class public final Llt/noframe/ratemeplease/triggers/TimeTrigger;
.super Llt/noframe/ratemeplease/abs/AbsTrigger;
.source "TimeTrigger.kt"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Llt/noframe/ratemeplease/abs/AbsTrigger<",
        "Ljava/lang/Long;",
        ">;"
    }
.end annotation


# static fields
.field public static final INSTANCE:Llt/noframe/ratemeplease/triggers/TimeTrigger;

.field private static final default:J

# The value of this static final field might be set in the static constructor
.field private static final key:Ljava/lang/String; = "time_trigger"

.field private static final threshHold:J


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .line 13
    new-instance v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;

    invoke-direct {v0}, Llt/noframe/ratemeplease/triggers/TimeTrigger;-><init>()V

    sput-object v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->INSTANCE:Llt/noframe/ratemeplease/triggers/TimeTrigger;

    const-string v0, "time_trigger"

    .line 14
    sput-object v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->key:Ljava/lang/String;

    .line 15
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    sput-wide v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->default:J

    .line 16
    sget-object v0, Llt/noframe/ratemeplease/Conf;->Companion:Llt/noframe/ratemeplease/Conf$Companion;

    invoke-virtual {v0}, Llt/noframe/ratemeplease/Conf$Companion;->getIns()Llt/noframe/ratemeplease/Conf;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/ratemeplease/Conf;->getMinTimeInMillsPassed()J

    move-result-wide v0

    sput-wide v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->threshHold:J

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .line 13
    invoke-direct {p0}, Llt/noframe/ratemeplease/abs/AbsTrigger;-><init>()V

    return-void
.end method


# virtual methods
.method public get(Landroid/content/Context;)Ljava/lang/Long;
    .locals 3

    const-string v0, "c"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 26
    invoke-static {p1}, Llt/noframe/ratemeplease/utils/UtilsKt;->sp(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object p1

    invoke-virtual {p0}, Llt/noframe/ratemeplease/triggers/TimeTrigger;->getKey()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0}, Llt/noframe/ratemeplease/triggers/TimeTrigger;->getDefault()Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    invoke-interface {p1, v0, v1, v2}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object p1

    return-object p1
.end method

.method public getDefault()Ljava/lang/Long;
    .locals 2

    .line 15
    sget-wide v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->default:J

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    return-object v0
.end method

.method public getKey()Ljava/lang/String;
    .locals 1

    .line 14
    sget-object v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->key:Ljava/lang/String;

    return-object v0
.end method

.method public getThreshHold()Ljava/lang/Long;
    .locals 2

    .line 16
    sget-wide v0, Llt/noframe/ratemeplease/triggers/TimeTrigger;->threshHold:J

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    return-object v0
.end method

.method public isTriggered(Landroid/content/Context;)Z
    .locals 4

    const-string v0, "c"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 29
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    invoke-virtual {p0, p1}, Llt/noframe/ratemeplease/triggers/TimeTrigger;->get(Landroid/content/Context;)Ljava/lang/Long;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    sub-long/2addr v0, v2

    invoke-virtual {p0}, Llt/noframe/ratemeplease/triggers/TimeTrigger;->getThreshHold()Ljava/lang/Long;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    cmp-long p1, v0, v2

    if-lez p1, :cond_0

    const/4 p1, 0x1

    goto :goto_0

    :cond_0
    const/4 p1, 0x0

    :goto_0
    return p1
.end method
